/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.iti.jets.gpts.bean;

import com.iti.jets.gpts.pojo.TranService;
import com.iti.jets.gpts.service.TranServiceService;
import com.sun.jersey.api.client.UniformInterfaceException;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.faces.context.FacesContext;
import org.codehaus.jettison.json.JSONException;

/**
 *
 * @author khalifaabdelaziz
 */
@ManagedBean
@RequestScoped
public class TranServiceBean {

    /**
     * Creates a new instance of TranServiceBean
     */
   
    private TranService selectedts;
    
    public TranServiceBean() {
        try {
            service = new TranServiceService();
            tranServices=  service.getAllTranService();
        } catch (UniformInterfaceException ex) {
            Logger.getLogger(TranServiceBean.class.getName()).log(Level.SEVERE, null, ex);
        } catch (JSONException ex) {
            Logger.getLogger(TranServiceBean.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
    public String  sendData()
    {
      FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put("ts", selectedts);
      
        return "viewandedittransservice";
    }
    private List<TranService> tranServices;
    private TranServiceService service;
    private TranService tranService;
    

    public List<TranService> getTranServices() {
        return tranServices;
    }

    public void setTranServices(List<TranService> tranServices) {
        this.tranServices = tranServices;
    }

    public TranServiceService getService() {
        return service;
    }

    public void setService(TranServiceService service) {
        this.service = service;
    }

    public TranService getTranService() {
        return tranService;
    }

    public void setTranService(TranService tranService) {
        this.tranService = tranService;
    }

    public TranService getSelectedts() {
        return selectedts;
    }

    public void setSelectedts(TranService selectedts) {
        this.selectedts = selectedts;
    }

}
